
---
title: \begin{Large} Who represents the constituency? Online political communication
  by members of parliament in the German mixed-member electoral system \end{Large}
author: Lennart Schürmann \& Sebastian Stier
date: \textsc{Online Appendix}
df_print: paged
output:
  pdf_document:
    includes:
      in_header: Helper/header.tex
    latex_engine: xelatex
    number_sections: yes
  html_document:
    df_print: paged
  word_document: default
fig_caption: yes
bibliography: Helper/bibtex.bib
biblio-style: apa6
link-citations: yes
linkcolor: blue
urlcolor: blue
---

\tableofcontents
\newpage

```{r setup, include=FALSE, error=FALSE, echo=FALSE, warning=FALSE}
library(easypackages)

packages("knitr", "tinytex", "kableExtra", "xtable",
          "summarytools", "reporttools", 
          "texreg", "stargazer", 
          "lmerTest", "lmtest", "MASS",
          "tidyverse","ggpubr")

libraries("knitr", "tinytex", "kableExtra", "xtable",
          "summarytools", "reporttools",  
          "texreg", "stargazer", 
          "lmerTest", "lmtest", "MASS",
          "tidyverse","ggpubr")

knitr::opts_chunk$set(include=FALSE, error=FALSE, echo=FALSE, warning=FALSE, message = FALSE)

options(scipen = 999, digits=2)

```


```{r load data, results='asis', include=FALSE}

#load prepared dataset
df <- read_rds("Data/df_analysis.rds") 

dat <- df 

```


```{r description of the dataset (numbers reported in text), results='asis', include=FALSE}

#number of FB accounts
sum(df$fb_active==1) / nrow(df)

#number of TW accounts
sum(df$tw_active==1) / nrow(df)

#number of FB posts
sum(df$fb_freq, na.rm=TRUE)
mean(df$fb_freq, na.rm = TRUE)
range(df$fb_freq, na.rm = TRUE)

#number of tweets
sum(df$tw_freq, na.rm = TRUE)
mean(df$tw_freq, na.rm = TRUE)
range(df$tw_freq, na.rm = TRUE)

#geographic references Facebook
sum(df$Posts2constituency, na.rm = T)
range(df$Posts2constituency, na.rm = T)
mean(df$Posts2constituency, na.rm = T)

#geographic references Twitter
sum(df$Tweets2constituency, na.rm = T)
range(df$Tweets2constituency, na.rm = T)
mean(df$Tweets2constituency, na.rm = T)

#regionalized wording Facebook
sum(df$fb_regionalization, na.rm = T)
range(df$fb_regionalization, na.rm = T)
mean(df$fb_regionalization, na.rm = T)

#regionalized wording Twitter
sum(df$tw_regionalization, na.rm = T)
range(df$tw_regionalization, na.rm = T)
mean(df$tw_regionalization, na.rm = T)

```


\section{Time series of social media posts}

Figures \ref{fig:ts_fb} and \ref{fig:ts_tw} show a rather constant distribution of Facebook posts and tweets by MPs over time. 

```{r facebook_time_series, results='asis', include=TRUE, out.width = '74%', fig.align = "center", fig.cap="\\label{fig:ts_fb}Temporal distribution of Facebook posts by German MPs.", fig.width=6.7, fig.height=5}

#Calculated offline since the raw Twitter data cannot be shared.

load("Helper/fb_byday.Rda")
fb_byday

```


```{r twitter_time_series, results='asis', include=TRUE, out.width = '74%', fig.align = "center", fig.cap="\\label{fig:ts_tw}Temporal distribution of tweets by German MPs.", fig.width=6.7, fig.height=5}

#Calculated offline since the raw Twitter data cannot be shared.

load("Helper/tw_byday.Rda")
tw_byday

```


\newpage

\section{Operationalization of variables}

\textbf{Electoral marginality (competitive district candidacy)}  

Another potential factor shaping MPs' incentives to use regional references in their communication is electoral marginality, i.e., the "absolute difference in percentage points between their nominal vote share and the vote share of the district winner (in case of losers) or first losers (in case of winners)" [@zittel_geographic_2019, p. 16]. Following @zittel_individualised_2008, we assume that MPs perceive their chance of winning a district in terms of a binary threshold. Either there is a chance to win the district or not. We use the proposed value of 10% as a threshold for candidates to perceive their district as winnable but obtain similar results with several other thresholds. Our reference data to calculate the electoral marginality comes from data on the electoral results in the previous federal election in 2017 that is provided by the Federal Returning Officer (*Bundeswahlleiter*). 

\textbf{Party list electoral viability (safe party list position)}    

To estimate the viability of an MP to enter the next parliament via a party list, we adjust an approach used by @wessels.2011 in the context of European Parliament elections. MPs with a safe party list in 2017 have a high likelihood to again be placed highly on a party list. By that, they are therefore less incentiviced to cultivate a personal vote by addressing the concerns of their district. To additionally incorporate uncertainty about one's electoral chances via the party list, we take the average of major national polls taken after the 2017 election until the end of our research period in February 2020 from [Wikipedia](https://de.wikipedia.org/wiki/Bundestagswahl_2021/Umfragen_und_Prognosen#Letzte_Umfragen_vor_der_Wahl). We then compare the existing seat distribution of parties across states with the predicted seats per party per state according to the polling average. Finally, we take the standard deviation of the discrepancy between the predictions and the 2017 seats for each state. Following @wessels.2011, a list position one standard deviation below the predicted seats classifies an MP's list position as save. A list position one standard deviation above the discrepancy is classified as unpromising, with the remaining candidates classified as doubtful. For the analysis, we construct a binary variable marking MPs with a safe party list position, under the assumption that MPs regard the previous election and current polls as the reference points to assess their electoral chances.

\textbf{Emphasis on local politics}    

To estimate the parties' emphasis on local politics, we use a variable from a dataset of the \textit{Comparative Manifesto Project}. This dataset relies on a quantitative content analysis of party manifestos to quantify parties' policy positions [@volkens_manifesto_2021, p. 2]. It is particularly appropriate in our context as the analysis is based on the party manifestos written for the election directly preceding the legislative period we analyze. The variable \textit{per301} measures a party's focus on the decentralization of political, economic, and cultural power. The variable operationalizes, for instance, the "Support for the continuation and importance of local and regional customs and symbols and/or deference to local expertise" [@volkens_manifesto_2021, p. 13] and "Favourable mentions of special consideration for sub-national areas" [@volkens_manifesto_2021, p. 13].

\newpage

\section{Descriptive statistics}

Descriptive statistics for the dependent variables are shown in Table \ref{tab:descriptives_dv}, for the independent and control variables in Table \ref{tab:descriptives_ivs}. 

```{r descriptive statistics, error=FALSE, echo=FALSE, results='asis', include=TRUE}

df <- df %>% as.data.frame()

## DVs
stargazer(df[c("Posts2constituency",
               "Tweets2constituency",
               "fb_regionalization", 
               "tw_regionalization")], 
          summary.stat = c("n", "mean", "median", "sd", "min", "max"),
					title = "Descriptive statistics: Dependent variables", 
					covariate.labels = c("Facebook Geographic references",
					                   "Twitter Geographic references",
					                   "Facebook Regionalized wording",
					                   "Twitter Regionalized wording"), 
          notes.append = FALSE, digits = 2, 
          table.placement = "H", header = FALSE, label = "tab:descriptives_dv") 

## IVs
stargazer(df[c("direct", 
               "chance_to_win_district_10",
               "safelist",
               "decentralization",
               "CDUCSU",
               "academic", 
               "age2017", 
               "sex", 
               "partylistleader_0", 
               "renewed_candidacy", 
                "population_density",	 
                "household_income", 
                "universityentrancepercent", 
                "youngdemographypercent",
               "fb_freq",
               "tw_freq")], 
          summary.stat = c("n", "mean", "median", "sd", "min", "max"),
					title = "Descriptive statistics: Independent and control variables.", 
					covariate.labels = c("Direct mandate",
					                     "Electoral marginality (10\\% threshold)",
					                     "Party list viability",
					                     "Party emphasis on local politics",
					                     "CDU/CSU",
					                   "Highly educated", 
					                   "Age (in 2017)",
					                   "Gender (male = 1)",
					                   "Party list leader",
					                   "Incumbent",
					                   "Population density",
					                   "Income of private households",
					                   "University entrance qualification",
					                   "Share of young population",
					                   "Facebook frequency",
                             "Twitter frequency"), 
          notes.append = FALSE, digits = 2, 
          table.placement = "H", header = FALSE, label = "tab:descriptives_ivs") 


```

\newpage 

\section{Candidacy and mandate mode effects}

```{r interaction plots candidacy, error=FALSE, echo=FALSE, results='asis', include=FALSE}

#* Geographic references
controls <- c("direct", "sex", "direct*dual_candidacy", "age2017", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent","chance_to_win_district_10", "safelist")
model_geoFB_int <- glm.nb(as.formula(paste0("Posts2constituency ~ ", 
                                     paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                          data = dat)
model_geoTW_int <- glm.nb(as.formula(paste0("Tweets2constituency ~ ", 
                                     paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                          data = dat)

#* Regionalized wording
model_regFB_int <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                     paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                          data = dat)
model_regTW_int <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                     paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                          data = dat)

#* Interaction models
dat_regFB_int <- ggeffects::ggpredict(model_regFB_int, terms = c("dual_candidacy", "direct"), ci.lvl = 0.95) 
dat_regFB_int$group <- dplyr::recode(dat_regFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regFB_int$x <- dplyr::recode(dat_regFB_int$x, "0" = "Exclusive", "1" = "Dual")

p.int_regFB_int <- ggplot(dat_regFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ylab('Regionalized wording') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_regTW_int <- ggeffects::ggpredict(model_regTW_int, terms = c("dual_candidacy", "direct"), ci.lvl = 0.95) 
dat_regTW_int$group <- dplyr::recode(dat_regTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regTW_int$x <- dplyr::recode(dat_regTW_int$x, "0" = "Exclusive", "1" = "Dual")

p.int_regTW_int <- ggplot(dat_regTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoFB_int <- ggeffects::ggpredict(model_geoFB_int, terms = c("dual_candidacy", "direct"), ci.lvl = 0.95) 
dat_geoFB_int$group <- dplyr::recode(dat_geoFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoFB_int$x <- dplyr::recode(dat_geoFB_int$x, "0" = "Exclusive", "1" = "Dual")

p.int_geoFB_int <- ggplot(dat_geoFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ggtitle('Facebook') +
  ylab('Geographic references') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoTW_int <- ggeffects::ggpredict(model_geoTW_int, terms = c("dual_candidacy", "direct"), ci.lvl = 0.95) 
dat_geoTW_int$group <- dplyr::recode(dat_geoTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoTW_int$x <- dplyr::recode(dat_geoTW_int$x, "0" = "Exclusive", "1" = "Dual")

p.int_geoTW_int <- ggplot(dat_geoTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ggtitle('Twitter') + 
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))

#Plot
theme_set(theme_pubr())
plot.interactions <- ggarrange(p.int_geoFB_int, 
                               p.int_geoTW_int,
                               p.int_regFB_int,
                               p.int_regTW_int, 
                               common.legend = T,
                               legend = "right",
                               ncol = 2, nrow = 2)
plot.interactions.annotated <- annotate_figure(plot.interactions,
                left = text_grob("Predicted values", rot = 90))


```


```{r fig_candidacy, fig.cap="\\label{fig:candidacy}Interaction of mandate mode and candidacy type: predicted values and 95% confidence intervals.", include=TRUE}

plot.interactions.annotated

```

Beyond our primary analysis of the mandate as such, we also attempt to disentangle how the mandate mode (direct or list) interacts with the candidacy type (dual or exclusive). The German mixed-member electoral system offers the option of running for a mandate in the constituency (Direct mandate) and simultaneously on a party list. Most candidates run for a direct mandate and on a party list seat, which is called dual candidacy (share of dual candidacies: `r nrow(subset(dat, dual_candidacy == 1))/nrow(dat)*100`\%). 

Figure \ref{fig:candidacy} illustrates the interaction of the candidacy type (dual or exclusive) with the final mandate the MPs obtained. As exclusive candidacies are relatively seldom compared to dual candidacies, the respective confidence intervals are comparatively larger. First and foremost, we can see on all panels that directly elected MPs regionalize their social media content more often by using geographic references or regionalized wording than their colleagues elected via party lists. This effect is more pronounced with regard to exclusive candidates. The fact that the effects for directly elected MPs with dual candidacies and MPs elected via party lists with dual candidacies are relatively closer to each other is also in line the main argument of the paper. A direct candidacy in the previous election is associated with a more intense use of geographic references and regionalized wording, even when the mandate was won via a party list. Yet due to the relatively small number of exclusive candidacies as district candidates or exclusively on party lists, the confidence intervals are large and these differences not statistically significant.

These findings provide limited evidence that exclusive and dual candidates of the respective mandate mode behave differently with regard to regional representation in online communication. Nevertheless, future research projects could generate a larger number of cases with a longer time frame covering several legislative periods, thus potentially mitigating the issue of large confidence intervals for exclusive candidates. 

\newpage 


\section{Effect heterogeneity by gender}

```{r}

# Regular models

# Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10", "safelist")
model_geoFB <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_geoTW <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Regionalized wording
model_regFB <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_regTW <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Prediction plots

# Regular models
dat_regFB <- ggeffects::ggpredict(model_regFB, terms = c("sex"), ci.lvl = 0.95) 
dat_regFB$x <- dplyr::recode(dat_regFB$x, "0" = "female", "1" = "male")

p.int_regFB <- ggplot(dat_regFB, aes(x, predicted)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ylab('Regionalized wording') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_regTW <- ggeffects::ggpredict(model_regTW, terms = c("sex"), ci.lvl = 0.95) 
dat_regTW$x <- dplyr::recode(dat_regTW$x, "0" = "female", "1" = "male")

p.int_regTW <- ggplot(dat_regTW, aes(x, predicted)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoFB <- ggeffects::ggpredict(model_geoFB, terms = c("sex"), ci.lvl = 0.95) 
dat_geoFB$x <- dplyr::recode(dat_geoFB$x, "0" = "female", "1" = "male")

p.int_geoFB <- ggplot(dat_geoFB, aes(x, predicted)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ggtitle('Facebook') +
  ylab('Geographic references') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + scale_colour_manual(values = c("darkgrey", "black"))


dat_geoTW <- ggeffects::ggpredict(model_geoTW, terms = c("sex"), ci.lvl = 0.95) 
dat_geoTW$x <- dplyr::recode(dat_geoTW$x, "0" = "female", "1" = "male")

p.int_geoTW <- ggplot(dat_geoTW, aes(x, predicted)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ggtitle('Twitter') + 
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))

#Plot
theme_set(theme_pubr())
plot.gender <- ggarrange(p.int_geoFB, 
                               p.int_geoTW,
                               p.int_regFB,
                               p.int_regTW, 
                               common.legend = T,
                               legend = "right",
                               ncol = 2, nrow = 2)
plot.gender.annotated <- annotate_figure(plot.gender,
                left = text_grob("Predicted values", rot = 90))
```


```{r fig_sex_main, fig.cap="\\label{fig:sex_main}Predicted values and 95% confidence intervals of the gender variable.", include=TRUE,fig.height = 5, fig.width = 5.5}

plot.gender.annotated

```

A burgeoning literature has shown that female and male politicians communicate differently on social media [e.g.,@evans_women_2016; @evans_you_2016; @meeks_gendered_2016; @wagner_i_2017] and beyond. Based on a sample of British citizens, @campbell_understanding_2008 find that women are especially interested in lower levels of politics. This finding is mirrored by @coffe_women_2013, who shows that women are more interested in local politics than men. Focusing on Finland, @rapeli_comparing_2014 also finds evidence that local politics is particularly interesting for women. In this exploratory section, we analyze whether the particular importance of local politics to women also translates into a different communication behavior of female politicians in the online sphere. 

Figure \ref{fig:sex_main} illustrates the effects of gender on MPs' usage of geographic references and regionalized wording on Facebook and Twitter. Based on our sample, we cannot observe significant differences between male and female politicians. In the next step, we examine how the gender effect interferes with the mandate mode. Figure \ref{fig:sex} visualizes the effects of models including interaction effects of the mandate mode and the politician's gender. First, with regard to the usage of regional wording, male and female MPs do not differ in their online political communication. Regardless of their gender, regional representation is substantially and significantly more prevalent among direct MPs. 


```{r interaction_plots_gender, error=FALSE, echo=FALSE, results='asis', include=FALSE}

#* Geographic references
controls <- c("direct", "sex", "direct*sex", "age2017", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent","chance_to_win_district_10", "safelist")
model_geoFB_int <- glm.nb(as.formula(paste0("Posts2constituency ~ ", 
                                     paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                          data = dat)
model_geoTW_int <- glm.nb(as.formula(paste0("Tweets2constituency ~ ", 
                                     paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                          data = dat)

#* Regionalized wording
model_regFB_int <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                     paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                          data = dat)
model_regTW_int <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                     paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                          data = dat)

#* Interaction models
dat_regFB_int <- ggeffects::ggpredict(model_regFB_int, terms = c("sex", "direct"), ci.lvl = 0.95) 
dat_regFB_int$group <- dplyr::recode(dat_regFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regFB_int$x <- dplyr::recode(dat_regFB_int$x, "0" = "female", "1" = "male")

p.int_regFB_int <- ggplot(dat_regFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ylab('Regionalized wording') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_regTW_int <- ggeffects::ggpredict(model_regTW_int, terms = c("sex", "direct"), ci.lvl = 0.95) 
dat_regTW_int$group <- dplyr::recode(dat_regTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regTW_int$x <- dplyr::recode(dat_regTW_int$x, "0" = "female", "1" = "male")

p.int_regTW_int <- ggplot(dat_regTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoFB_int <- ggeffects::ggpredict(model_geoFB_int, terms = c("sex", "direct"), ci.lvl = 0.95) 
dat_geoFB_int$group <- dplyr::recode(dat_geoFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoFB_int$x <- dplyr::recode(dat_geoFB_int$x, "0" = "female", "1" = "male")

p.int_geoFB_int <- ggplot(dat_geoFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ggtitle('Facebook') +
  ylab('Geographic references') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoTW_int <- ggeffects::ggpredict(model_geoTW_int, terms = c("sex", "direct"), ci.lvl = 0.95) 
dat_geoTW_int$group <- dplyr::recode(dat_geoTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoTW_int$x <- dplyr::recode(dat_geoTW_int$x, "0" = "female", "1" = "male")

p.int_geoTW_int <- ggplot(dat_geoTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ggtitle('Twitter') + 
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))

#Plot
theme_set(theme_pubr())
plot.interactions <- ggarrange(p.int_geoFB_int, 
                               p.int_geoTW_int,
                               p.int_regFB_int,
                               p.int_regTW_int, 
                               common.legend = T,
                               legend = "right",
                               ncol = 2, nrow = 2)
plot.interactions.annotated <- annotate_figure(plot.interactions,
                left = text_grob("Predicted values", rot = 90))


```


```{r fig_sex, fig.cap="\\label{fig:sex}Predicted values and 95% confidence intervals of the interaction of the mandate mode with gender.", include=TRUE,fig.height = 5, fig.width = 5.5}

plot.interactions.annotated

```

\newpage


\section{Effect heterogeneity by party}  

In this section, we investigate the role of MPs' party affiliation. Figure \ref{fig:descriptive_party} illustrates the distribution of mandates with absolute values for each party. While the colored dots illustrate the values for list MPs, grey dots show the values for direct MPs of the respective party. The plot reveals a considerable variation across parties. Nearly all parties have more list MPs than direct MPs, the only outlier being the CDU/CSU party group with a remarkably larger number of directly elected MPs. The main takeway from this descriptive plot is the high correlation between party membership and the mandate mode. In order to avoid multicollinearity, we therefore use the continuous measure of \textit{emphasis on local politics} in the main paper that more directly captures the relevant variation in MPs' strategy than the party dummies. 

We still analyzed heterogeneity contingent on CDU/CSU membership. The CDU/CSU is the most relevant party in the context of our analysis, as the chances of getting a direct mandate are considerably higher for CDU/CSU candidates compared to other parties. Including a CDU/CSU dummy might also control for the fact that the conservative parliamentary group emphasizes local politics and their attachment to the home country and region (*Heimat*) in their political communication. Furthermore, the CDU/CSU is the least social-media-savvy party group with the lowest average number of social media posts in our data. Members of the CDU/CSU are less frequently present on social media than the average MP (share of MPs with Facebook account: \textit{CDU/CSU} `r (prop.table(table(dat$CDUCSU,dat$fb_active),1)[2,2])`, \textit{Other parties} `r (prop.table(table(dat$CDUCSU,dat$fb_active),1)[1,2])`, share of MPs with Twitter account: \textit{CDU/CSU} `r  (prop.table(table(dat$CDUCSU,dat$tw_active),1)[2,2])`, \textit{Other parties} `r  (prop.table(table(dat$CDUCSU,dat$tw_active),1)[1,2])`). 

Table \ref{tab:cducsu} and Figure \ref{fig:cducsu} show the results of models including an interaction of the mandate mode and the CDU/CSU party dummy. Directly elected CDU/CSU members have similar predicted values as directly elected MPs of other parties. Since almost all CDU/CSU MPs are directly elected, the visualizations reveal a limited effect heterogeneity depending on the party. In contrast, the group of CDU/CSU MPs who were elected via party lists and are active on social media consists of only `r nrow(subset(dat, CDUCSU == 1 & direct == 0 & fb_active == 1))` MPs on Facebook and a meager `r nrow(subset(dat, CDUCSU == 1 & direct == 0 & tw_active == 1))` MPs on Twitter. Due to the small group size, outliers heavily affect the size of the confidence intervals for this particular subgroup.



```{r descriptive_plots_party_variance, results = 'asis', include=FALSE}

party_results <- df %>%
  mutate(count = 1) %>%
  dplyr::select(party, direct, count, Posts2constituency, Tweets2constituency, fb_regionalization, tw_regionalization) %>%
  group_by(party, direct) %>%
  mutate(direct = case_when(direct == 1 ~ "Direct",
                            direct == 0 ~ "List")) %>%
  summarise(sum_count = sum(count),
            sum_Posts2constituency = sum(Posts2constituency, na.rm = T),
            sum_Tweets2constituency = sum(Tweets2constituency, na.rm = T),
            sum_fb_regionalization = sum(fb_regionalization, na.rm = T),
            sum_tw_regionalization = sum(tw_regionalization, na.rm = T)) %>%
  mutate(mandate_count = paste0(direct,": ",sum_count))

parties <- unique(party_results$party)
mandates <- c("Direct: 3 \n List: 91", 
             "Direct: 231 \n List: 15",
             "Direct: 0 \n List: 80",
             "Direct: 1 \n List: 66",
             "Direct: 5 \n List: 64",
             "Direct: 59 \n List: 94")


mandates.plot <- ggplot(party_results, aes(as.numeric(as.factor(party)), sum_count, shape = direct, color = party)) +
  geom_point(size = 3, fill = "lightgrey") +
  theme_bw() +
  coord_flip() +
  scale_color_manual(breaks = c("Greens", "Left party", "AfD", "SPD", "CDU/CSU","FDP"),
                     values = c("#87BB3F", "#AF3C74", "#22529F","#C6352B","#0e0a0d","#F7CE46")) +
  scale_shape_manual(values = c(21, 16)) +
  xlab(element_blank()) +
  ylab("Number of MPs")   +
  theme(legend.position = "bottom",
        axis.text.y = element_text(size=7.5),
        axis.title.x = element_text(size=9),
        legend.title = element_blank()) +
  guides(color = FALSE) +
  scale_x_continuous(breaks = 1:length(parties),
                     labels = parties,
                     sec.axis = sec_axis(~.,
                                         breaks = 1:length(mandates),
                                         labels = mandates))  


```

```{r descriptive_plots_by_party, fig.cap="\\label{fig:descriptive_party}Distribution of mandates. Absolute values for each party.", include=TRUE,fig.height = 2.5, fig.width = 6}
mandates.plot  
```

\blandscape

```{r party_heterogeneity, results = 'asis', include=TRUE}

# Regular models

# Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "CDUCSU", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10","safelist")

model_geoFB <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_geoTW <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Regionalized wording
model_regFB <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_regTW <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Interaction models

# Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "CDUCSU*direct", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10","safelist")

model_geoFB_int <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_geoTW_int  <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

#* Regionalized wording
model_regFB_int  <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_regTW_int  <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Print results

texreg(list(model_geoFB,model_geoFB_int, 
            model_geoTW,model_geoTW_int, 
            model_regFB,model_regFB_int,
            model_regTW, model_regTW_int),
        custom.header = list("Geographic references" = 1:4,
                             "Regionalized wording" = 5:8),
        custom.model.names = c("Facebook","Facebook",
                               "Twitter", "Twitter",
                               "Facebook", "Facebook",
                               "Twitter", "Twitter"),
        stars = c(0.001, 0.01, 0.05),
        digits = 2, 
        label = "tab:cducsu",
        use.packages = FALSE, 
        custom.note = "Note: Negative binomial regression models with unstandardized coefficients and standard errors. %stars",
        scalebox = 0.9,
        float.pos = "H",
        caption = "Effects of the mandate mode on regionalized wording and geographic references in MPs' social media posts, including CDU/CSU.",
        caption.above = TRUE,
        single.row = TRUE,
        include.adjrs = TRUE, 
        include.nobs = TRUE,
        include.bic = FALSE,
        include.dispersion = FALSE,
        include.groups = FALSE,
        custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "chance_to_win_district_10:safelist" = "Electoral marginality x Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Spitzenkandidat_in",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "(Intercept)" = "Intercept")
        )


```
\elandscape

```{r interaction_plot, error=FALSE, echo=FALSE, results='asis', include=FALSE}

#* Interaction models
dat_regFB_int <- ggeffects::ggpredict(model_regFB_int, terms = c("CDUCSU", "direct"), ci.lvl = 0.95) 
dat_regFB_int$group <- dplyr::recode(dat_regFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regFB_int$x <- dplyr::recode(dat_regFB_int$x, "0" = "Other parties", "1" = "CDU/CSU")

p.int_regFB_int <- ggplot(dat_regFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ylab('Regionalized wording') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_regTW_int <- ggeffects::ggpredict(model_regTW_int, terms = c("CDUCSU", "direct"), ci.lvl = 0.95) 
dat_regTW_int$group <- dplyr::recode(dat_regTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_regTW_int$x <- dplyr::recode(dat_regTW_int$x, "0" = "Other parties", "1" = "CDU/CSU")

p.int_regTW_int <- ggplot(dat_regTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank(), 
        plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoFB_int <- ggeffects::ggpredict(model_geoFB_int, terms = c("CDUCSU", "direct"), ci.lvl = 0.95) 
dat_geoFB_int$group <- dplyr::recode(dat_geoFB_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoFB_int$x <- dplyr::recode(dat_geoFB_int$x, "0" = "Other parties", "1" = "CDU/CSU")

p.int_geoFB_int <- ggplot(dat_geoFB_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25) + 
  theme_minimal() +
  ggtitle('Facebook') +
  ylab('Geographic references') + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))


dat_geoTW_int <- ggeffects::ggpredict(model_geoTW_int, terms = c("CDUCSU", "direct"), ci.lvl = 0.95) 
dat_geoTW_int$group <- dplyr::recode(dat_geoTW_int$group, "0" = "List MPs", "1" = "Direct MPs")
dat_geoTW_int$x <- dplyr::recode(dat_geoTW_int$x, "0" = "Other parties", "1" = "CDU/CSU")

p.int_geoTW_int <- ggplot(dat_geoTW_int, aes(x, predicted, colour = group)) +
  geom_point(position = position_dodge(.3), size = 2) +
  geom_errorbar(
    aes(ymin = conf.low, ymax = conf.high),
    position = position_dodge(.3), width = 0.25
  ) + 
  theme_minimal() +
  ggtitle('Twitter') + 
  ylab(element_blank()) + 
  xlab(element_blank()) +
  theme(legend.title = element_blank()) + 
  scale_colour_manual(values = c("darkgrey", "black"))

#Plot
theme_set(theme_pubr())
plot.interactions <- ggarrange(p.int_geoFB_int, 
                               p.int_geoTW_int,
                               p.int_regFB_int,
                               p.int_regTW_int, 
                               common.legend = T,
                               legend = "right",
                               ncol = 2, nrow = 2)
plot.interactions.annotated <- annotate_figure(plot.interactions,
                left = text_grob("Predicted values", rot = 90))


```


```{r fig_cducsu, fig.cap="\\label{fig:cducsu}Predicted values and 95% confidence intervals of the interaction of the mandate mode with CDU/CSU membership.", include=TRUE,fig.height = 5, fig.width = 5.5}

plot.interactions.annotated

```


\newpage

\section{Additional regression models}  

```{r additional models activity, results = 'asis', include=TRUE}

#* has account
controls <- c("direct", "academic", "age2017", "sex", "partylistleader_0", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10", "safelist")
model_regFB <- glm(as.formula(paste0("fb_active ~ ", paste0(controls, collapse = "+"))),
                      family = binomial, data = dat)
model_regTW <- glm(as.formula(paste0("tw_active ~ ", paste0(controls, collapse = "+"))),
                               family = binomial, data = dat)

#* activity
model_geoFB <- glm.nb(as.formula(paste0("fb_freq ~ ", paste0(controls, collapse = "+"))),
                     data = dat)
model_geoTW <- glm.nb(as.formula(paste0("tw_freq ~ ", paste0(controls, collapse = "+"))),
                     data = dat)


#Print
texreg(list(model_regFB, model_regTW, model_geoFB, model_geoTW),
                  custom.header = list("Presence on social media" = 1:2,
                            "Activity on social media" = 3:4),
        custom.model.names = c("Facebook", "Twitter",
                               "Facebook", "Twitter"),
                  stars = c(0.001, 0.01, 0.05),
                  digits = 2, 
                  use.packages = FALSE, 
       custom.note = "\\parbox[t]{16cm}{\\emph{Note:}\\label{tab:activity} Logistic regression models in models 1-2. Negative binomial regression models in models 3-4. Unstandardized coefficients and standard errors. %stars}",
                  #scalebox = 0.9,
                  float.pos = "H",
                  caption = "Regression models explaining the presence of social media accounts and the activity, measured as the number of posts.",
                  caption.above = TRUE,
                  single.row = TRUE,
                  include.adjrs = TRUE, 
                  include.nobs = TRUE,
                  include.bic = FALSE,
                  include.deviance = FALSE,
                  include.dispersion = FALSE,
                  include.groups = FALSE,
        custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Party list leader",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "party" = "Party",
               "(Intercept)" = "Intercept")
       )


```


```{r additional_models_interaction, results = 'asis', include=TRUE}

# Regular models

#* Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10*safelist")
model_geoFB <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_geoTW <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

#* Regionalized wording
model_regFB <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                 paste0(c(controls, "log(fb_freq+1)"), collapse = "+"))),
                      data = dat)
model_regTW <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                 paste0(c(controls, "log(tw_freq+1)"), collapse = "+"))),
                      data = dat)

# Print results

texreg(list(model_geoFB, model_geoTW, model_regFB, model_regTW),
        custom.header = list("Geographic references" = 1:2,
                             "Regionalized wording" = 3:4),
        custom.model.names = c("Facebook", "Twitter",
                               "Facebook", "Twitter"),
        stars = c(0.001, 0.01, 0.05),
        digits = 2, 
        use.packages = FALSE, 
        custom.note = "Note: Negative binomial regression models with unstandardized coefficients and standard errors. %stars",
        scalebox = 0.9,
        float.pos = "H",
        caption = "Effects of the mandate mode on regionalized wording and geographic references in MPs' social media posts, including an interaction of electoral marginality and party list viability.",
        caption.above = TRUE,
        single.row = TRUE,
        include.adjrs = TRUE, 
        include.nobs = TRUE,
        include.bic = FALSE,
        include.dispersion = FALSE,
        include.groups = FALSE,
        custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "chance_to_win_district_10:safelist" = "Electoral marginality x Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Spitzenkandidat_in (Party list leader)",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "(Intercept)" = "Intercept")
        )


```



```{r additional models social media engagement metrics, results = 'asis', include=TRUE}

#* Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10", "safelist")
model_geoFB <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                                 paste0(c(controls, "log(fb_freq+1) + log(fb_pagelikes+1) +
                                          log(fb_comments+1)"), 
                                        collapse = "+"))),
                      data = dat)
model_geoTW <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                                 paste0(c(controls, "log(tw_freq+1) + log(tw_followers+1) +
                                          log(tw_ment_freq+1)"), 
                                        collapse = "+"))),
                      data = dat)

#* Regionalized wording
model_regFB <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                                 paste0(c(controls, "log(fb_freq+1) + log(fb_pagelikes+1) +
                                          log(fb_comments+1)"), 
                                        collapse = "+"))),
                      data = dat)
model_regTW <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                                 paste0(c(controls, "log(tw_freq+1) + log(tw_followers+1) +
                                          log(tw_ment_freq+1)"), 
                                        collapse = "+"))),
                      data = dat)


texreg(list(model_geoFB, model_geoTW, model_regFB, model_regTW),
             custom.header = list("Geographic references" = 1:2, "Regionalized wording" = 3:4),
             custom.model.names = c("Facebook", "Twitter",
                                    "Facebook", "Twitter"),
                  digits = 2, 
                  stars = c(0.001, 0.01, 0.05),
                  use.packages = FALSE, 
       custom.note = "\\parbox[t]{16cm}{\\emph{Note:} Negative binomial regression models with unstandardized coefficients and standard errors. %stars}",
                  scalebox = 0.9,
                  float.pos = "H",
                  caption = "Effects of the mandate mode on regionalized wording and geographic references in MPs' social media posts, including social media metrics.",
                  caption.above = TRUE,
                  single.row = TRUE,
                  include.adjrs = TRUE, 
                  include.nobs = TRUE,
                  include.bic = FALSE,
                  include.deviance = FALSE,
                  include.dispersion = FALSE,
                  include.groups = FALSE,
                     custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Party list leader",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "party" = "Party",
               "(Intercept)" = "Intercept")
       )


```




```{r additional models no berlin, results = 'asis', include=TRUE}

dat_nober <- subset(dat, state != "Berlin")

#* Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10", "safelist")
model_geoFB <- glm.nb(as.formula(paste0("Posts2constituency ~ ",
                             paste0(c(controls, "log(fb_freq)"), collapse = "+"))),
                      data = dat_nober)
model_geoTW <- glm.nb(as.formula(paste0("Tweets2constituency ~ ",
                             paste0(c(controls, "log(tw_freq)"), collapse = "+"))),
                      data = dat_nober)

#* Regionalized wording
model_regFB <- glm.nb(as.formula(paste0("fb_regionalization ~ ", 
                             paste0(c(controls, "log(fb_freq)"), collapse = "+"))),
                      data = dat_nober)
model_regTW <- glm.nb(as.formula(paste0("tw_regionalization ~ ", 
                             paste0(c(controls, "log(tw_freq)"), collapse = "+"))),
                      data = dat_nober)


texreg(list(model_geoFB, model_geoTW, model_regFB, model_regTW),
             custom.header = list("Geographic references" = 1:2, "Regionalized wording" = 3:4),
             custom.model.names = c("Facebook", "Twitter",
                                    "Facebook", "Twitter"),
                  digits = 2, 
                  stars = c(0.001, 0.01, 0.05),
                  use.packages = FALSE, 
       custom.note = "\\parbox[t]{16cm}{\\emph{Note:} Negative binomial regression models with unstandardized coefficients and standard errors. %stars}",
                  scalebox = 0.9,
                  float.pos = "H",
                  caption = "Effects of the mandate mode on regionalized wording and geographic references in MPs' social media posts, MPs from Berlin excluded.",
                  caption.above = TRUE,
                  single.row = TRUE,
                  include.adjrs = TRUE, 
                  include.nobs = TRUE,
                  include.bic = FALSE,
                  include.deviance = FALSE,
                  include.dispersion = FALSE,
                  include.groups = FALSE,
                    custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Party list leader",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "party" = "Party",
               "(Intercept)" = "Intercept"),
       )


```


```{r additional models shares instead of counts, results = 'asis', include=TRUE}

dat <- dat %>% 
  rowwise() %>% 
  mutate(across(one_of(c("Tweets2constituency", "tw_regionalization")),
                list(c = ~ (. / tw_freq)*100), .names = "share_{.col}"),
         across(one_of(c("Posts2constituency", "fb_regionalization")),
                list(c = ~ (. / fb_freq)*100), .names = "share_{.col}")
  )


#* Geographic references
controls <- c("direct", "age2017", "sex", "partylistleader_0", "academic", 
              "renewed_candidacy", "decentralization", "dual_candidacy", 
              "population_density", "household_income", "universityentrancepercent", 
              "youngdemographypercent", "chance_to_win_district_10", "safelist")
model_geoFB <- lm(as.formula(paste0("share_Posts2constituency ~ ",
                             paste0(c(controls, "log(fb_freq)"), collapse = "+"))),
                      data = dat)
model_geoTW <- lm(as.formula(paste0("share_Tweets2constituency ~ ",
                             paste0(c(controls, "log(tw_freq)"), collapse = "+"))),
                      data = dat)

#* Regionalized wording
model_regFB <- lm(as.formula(paste0("share_fb_regionalization ~ ", 
                             paste0(c(controls, "log(fb_freq)"), collapse = "+"))),
                      data = dat)
model_regTW <- lm(as.formula(paste0("share_tw_regionalization ~ ", 
                             paste0(c(controls, "log(tw_freq)"), collapse = "+"))),
                      data = dat)


texreg(list(model_geoFB, model_geoTW, model_regFB, model_regTW),
             custom.header = list("Geographic references" = 1:2, "Regionalized wording" = 3:4),
             custom.model.names = c("Facebook", "Twitter",
                                    "Facebook", "Twitter"),
                  digits = 2, 
                  stars = c(0.001, 0.01, 0.05),
                  use.packages = FALSE, 
custom.note = "\\parbox[t]{16cm}{\\emph{Note:} Linear regression models with unstandardized coefficients and standard errors. %stars}",
                  scalebox = 0.9,
                  float.pos = "H",
                  caption = "Effects of the mandate mode on regionalized wording and geographic references in MPs' social media posts, percentage of all posts instead of counts as dependent variable.",
                  caption.above = TRUE,
                  single.row = TRUE,
                  include.adjrs = TRUE, 
                  include.nobs = TRUE,
                  include.bic = FALSE,
                  include.deviance = FALSE,
                  include.dispersion = FALSE,
                  include.groups = FALSE,
                     custom.coef.map = 
          list("direct" = "Direct mandate",
               "chance_to_win_district_10" = "Electoral marginality (10% threshold)",
               "safelist" = "Party list viability",
               "decentralization" = "Party emphasis on local politics",
               "CDUCSU" = "CDU/CSU",
               "direct:CDUCSU" = "Direct mandate X CDU/CSU",
               "dual_candidacy" = "Dual candidacy",
               "academic" = "Highly educated",
               "age2017" = "Age (in 2017)",
               "sex" = "Gender (male = 1)",
               "renewed_candidacy" = "Incumbent",
               "partylistleader_0" = "Party list leader",
               "population_density" = "Population density",
               "household_income" = "Income of private households",
               "universityentrancepercent" = "University entrance qualification",
               "youngdemographypercent" = "Share of young population",
               "log(fb_freq_0 + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes_0 + 1)" = "Facebook page likes (logged)",
               "log(fb_comments_0 + 1)" = "Facebook comments (logged)",
               "log(tw_freq_0 + 1)" = "Twitter frequency (logged)",
               "log(tw_followers_0 + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq_0 + 1)" = "Twitter @-mentions (logged)",
               "log(fb_freq + 1)" = "Facebook frequency (logged)",
               "log(fb_pagelikes + 1)" = "Facebook page likes (logged)",
               "log(fb_comments + 1)" = "Facebook comments (logged)",
               "log(tw_freq + 1)" = "Twitter frequency (logged)",
               "log(tw_followers + 1)" = "Twitter followers (logged)",
               "log(tw_ment_freq + 1)" = "Twitter @-mentions (logged)",
               "(Intercept)" = "Intercept"),
       )


```

\newpage

\section{References}



